package entity;

import java.io.Serializable;

/**
 * @author zhangxin
 * @date 2020/9/22
 */
public class Student extends Person implements Serializable {

    private String name;

    public int age = 20;

    public Student(){
        System.out.println("Student constructor");
    }

    static {
        System.out.println("Student static");
    }

    {
        System.out.println("Student common");
    }


    @Override
    public String toString() {
        return "Student{} " + super.toString();
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

/*    @Override
    public String getName() {
        return name;
    }

    @Override
    public void setName(String name) {
        this.name = name;
    }
*/
    @Override
    public int getAge() {
        return age;
    }

    @Override
    public void setAge(int age) {
        this.age = age;
    }

    public static void main(String[] args) {
        Student student = new Student();
        Person person = student;
        Person person2 = new Student();
        System.out.println(student.age);
        System.out.println(person.getAge());
        System.out.println(person2.age);
    }

}
